{% load static %}
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">

<footer class="bd-footer py-4 py-md-5 mt-5 bg-body-tertiary">
    <div id="footer_content" class="container py-4 py-md-5 px-4 px-md-3 text-body-secondary">
        <script>
              var userTime = new Date();
              var serverTime = new Date("{% now "m\/\/d\/Y H\:i" %}");
              var footer = document.getElementById("footer_content");
              const formatter = new Intl.DateTimeFormat('ru-RU', {year: 'numeric', month: 'numeric', day: 'numeric',
               hour: '2-digit', minute: '2-digit'});

              var timeDiff = (Math.abs(userTime - serverTime)) / 3600000;

              if (timeDiff > 24) {
                footer.innerHTML = formatter.format(serverTime);
              }
              else {
                footer.innerHTML = formatter.format(userTime);
              }
        </script>
        <noscript>
            <p id="server_time">{% now "Y H\:i" %}</p>
        </noscript>
    </div>
</footer>